﻿using System;
using System.Windows;
using Microsoft.WindowsAzure.Samples.Phone.Storage;

namespace SkyConnector.Model
{
    public class CloudConnection
    {
        private TableServiceContext tableContext;
        private string tableName;
        private const string mKey = "TYnuYIU9cV9NS1uh+H9xa3ffd6P95aQ1lFoA0L1H/TrsDCqXprvNthrUbdcM/GGvSHjCB65yFYGkHtoCGblV3Q==" ;
        private Uri mBlobEndpoint;
        private Uri mTableEndpoint;
        private Uri mQueuesEndpoint;

        public CloudConnection()
        {
            mBlobEndpoint = new Uri("http://roastthermometer.blob.core.windows.net/");
            mTableEndpoint = new Uri("http://roastthermometer.table.core.windows.net/");
            mQueuesEndpoint = new Uri("http://roastthermometer.queue.core.windows.net/");

            var resolver = new CloudStorageClientResolverAccountAndKey(new StorageCredentialsAccountAndKey("roastthermometer", mKey), mBlobEndpoint, mQueuesEndpoint, mTableEndpoint, Deployment.Current.Dispatcher);

            CloudStorageContext.Current.Resolver = resolver;
        }
    }
}
